<div class="ItemsWarp items-text clearfix">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class='grid'>
 <tbody>
  <{if count($products) > 0}>
  <tr valign="top"> <{foreach from=$products item=product name=goods}>
    <td  id="pdt-<{$product.goods_id}>" product="<{$product.goods_id}>" width="<{math equation=floor(100/x) x=$env.conf.gallery.display.grid.colnum}>%;">   
       <div class="items-gallery <{$mask_webslice}>">
            <div class="goodpic" style='<{if $env.conf.site.thumbnail_pic_width !=0 && $env.conf.site.thumbnail_pic_height !=0}>height:<{$env.conf.site.thumbnail_pic_height}>px; <{/if}>'>
                <span  style='<{if $env.conf.site.thumbnail_pic_width !=0 && $env.conf.site.thumbnail_pic_height !=0}> width:<{$env.conf.site.thumbnail_pic_width}>px;height:<{$env.conf.site.thumbnail_pic_height}>px;<{/if}>'>
                <img src="<{$product.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager}>" alt="<{$product.name|escape:html}>"/>
                </span>
            </div>
              <div class="goodinfo" style="padding-top:12px;">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="entry-content">
                  <tr>
                    <td colspan="2">
                        <h6><input type="checkbox" name="diamond" /><{$product.name|escape:"html"}></h6>
                        <div style="display:none;text-align:center;" pruductid=<{$product.goods_id}>><img src="statics/dz.gif" alt="立即定制" title="立即定制" class="submit_diamond" style="cursor:pointer;" /></div>
                    </td>
                  </tr>
                </table>
              </div>
        </div>      
    </td>
    <{if !($smarty.foreach.goods.iteration%$env.conf.gallery.display.grid.colnum )}> 
    </tr>
  <{if !$smarty.foreach.goods.last}>
  <tr valign="top"> <{/if}>
    
    <{elseif $smarty.foreach.goods.last}>
    <td colspan="<{math equation='y' y=$env.conf.gallery.display.grid.colnum-$smarty.foreach.goods.iteration%$env.conf.gallery.display.grid.colnum}>">&nbsp;</td>
  </tr>
  <{/if}>
  <{/foreach}>
  <{/if}>
  </tbody>
</table>
</div>
<form method="post" action="" id="diamond_form" style="display:none;">
    <input type="hidden" name="bare_id" value="<{$bare_id}>" />
</form>

<script>
<!--
    var emuStatic = "<{$emuStatic}>";
        var pref = '';
    if ('1' != emuStatic){
        pref = '?';
    }
    var checkBoxEl = $$('.grid input[type=checkbox]');
    checkBoxEl.each(function(item){
        item.addEvent('click',function(){
            checkBoxEl.each(function(v){
                if (v.getParent().hasClass('hide_cur')){
                    v.getParent().show();
                    v.getParent().getNext().hide();
                }
            });
            this.getParent().addClass('hide_cur');
            this.checked=false;
            this.getParent().hide();
            this.getParent().getNext().show();
        });
    });

    /* 提交表单 */
    $$('.grid .submit_diamond').each(function(item){
        item.addEvent('click',function(){
            var form = $('diamond_form');
            var product_id = this.getParent().getProperty('pruductid');
            form.action = pref+'product-'+product_id+'.html';
            form.submit();
        });        
    });
//-->
</script>

<script>
void function(){
/*橱窗放大镜
  author:litie[A]shopex.cn
  [c]  ShopEx
  last update : 2009年9月25日14:51:20
*/
    (new Image()).src = '<{$base_url}>statics/loading.gif';
    var getAmongPos = function(size,to){
                 var elpSize = $(to).getSize();
                 return {
                    'top':Math.abs((elpSize.y/2).toInt()-(size.height/2).toInt()+to.getPosition().y+elpSize.scroll.y),
                    'left':Math.abs((elpSize.x/2).toInt()-(size.width/2).toInt()+to.getPosition().x+elpSize.scroll.x)
                 };
            };

   $$('.grid .zoom a').addEvent('click',function(e){
            e.stop();
            if(this.retrieve('active'))return;
            var _this = this;
            _this.store('active',true);
            var tpic = this.getParent('.items-gallery').getElement('.goodpic img');
            var bpic_src = this.get('pic');
           
           
           
            var loading = new Element('div',{
                 styles:{'background':'#fff url(<{$base_url}>statics/loading.gif) no-repeat 50% 50%',
                         'width':40,
                         'height':40,
                         'border':'1px #e9e9e9 solid',
                         'opacity':.5}}).inject(document.body).amongTo(tpic);
            
            
            new Asset.image(bpic_src,{onload:function(img){
                  
                  
                  
                  loading.remove();
                  var winsize = window.getSize();
                  var imgSize = $(img).zoomImg(winsize.x,winsize.y,1);
                  var fxv = $extend(getAmongPos(imgSize,window),imgSize);
                  var imgFx = new Fx.Morph(img,{link:'cancel'});
                  
            
                
    
                  
                  
                  img.setStyles($extend(tpic.getCis(),{opacity:0.5})).inject(document.body).addClass('img-zoom').addEvent('click',function(){
                    
                      imgFx.start(tpic.getCis()).chain(function(){this.element.remove();_this.store('active',false);
                     if(window.ie6) {
                      $E('.filtmode select').setStyle('visibility','visible'); }
                      });
                  });
                  
                if(window.ie6) {
                 $E('.filtmode select').setStyle('visibility','hidden'); }
                  imgFx.start($extend(fxv,{opacity:1}));
                  
                  
                  document.addEvent('click',function(){
                       
                       img.fireEvent('click');
                       document.removeEvent('click',arguments.callee);
                  
                  });
            
            },onerror:function(){
                _this.store('active',false);
                loading.remove();
            }});
            
   
   });
   
   
   }();
  
</script>